package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.Education;
import cn.wolfcode.crm.mapper.EducationMapper;
import cn.wolfcode.crm.service.IEducationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EducationServiceImpl implements IEducationService {
    @Autowired
    private EducationMapper mapper;
    public void save(Education education) {
        mapper.insert(education);

    }

    public void delete(Long id) {
        mapper.deleteByPrimaryKey(id);
    }

    public void update(Education education) {
        System.out.println(education);
        mapper.updateByPrimaryKey(education);
    }

    public Education get(Long id) {
        Education education = mapper.selectByPrimaryKey(id);
        return education;
    }

    public List<Education> listAll() {
        List<Education> list = mapper.selectAll();
        return list;
    }

}
